/*
 * Copyright (C) 2019-2020 Alibaba Group Holding Limited
 */


#include <stdlib.h>
#include <string.h>
#include <aos/aos.h>
#include "aos/cli.h"
#include "main.h"
#include "app_init.h"
#include "oled.h"

#define TAG "app"

extern void oled_draw_point4guilite(int x, int y, int rgb);
static struct EXTERNAL_GFX_OP
{
	void(*draw_pixel)(int x, int y, unsigned int rgb);
	void(*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb);
} gs_oled_gfx_ops;
extern void startHelloStar(void* phy_fb, int width, int height, int color_bytes, struct EXTERNAL_GFX_OP* gfx_op);

/* hello world 的 main 函数 */
int main(void)
{
    board_yoc_init();
    LOGD(TAG, "%s\n", aos_get_app_version());
    oled_init();
    gs_oled_gfx_ops.draw_pixel = oled_draw_point4guilite;
    startHelloStar(NULL, 128, 64, 1, &gs_oled_gfx_ops);

    while (1) {
        LOGD(TAG, "Red Say Hello world! YoC");
        aos_msleep(1000);
    }

    return 0;
}

